<template>
    <div>
<van-row>
  <van-col span="6" >
    <van-sidebar v-model="active" >
  <van-sidebar-item :title="item.cat_name" v-for="item in categoriesApiData"/>
</van-sidebar>
  </van-col>
  <van-col span="18">
   <div v-for="item in categoriesApiData[active]?.children">
    <h4>{{ item.cat_name }}</h4>
    <van-grid v-for="items in active.children">
  <van-grid-item :icon="items.cat_icon" :text="items.cat_name" />
</van-grid>
   </div>
  </van-col>
</van-row>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { categoriesApi } from '@/api/api';
let categoriesApiData=ref([])
let active=ref(1)
categoriesApi().then(res=>{
    categoriesApiData.value=res.data.message
    console.log(res.data.message);
    
});
</script>

<style lang="scss" scoped>

</style>